define(function(require, exports, module) {
	require('jquery');
	require('easing');
	require('fancybox');
	require('jscrollpane');
	require('mousewheel');
	require('jcookie');
	var user = require('user');

	$.extend({
		testAct: function(str,reg){
			return(reg.test(str));
		},
		testBasic: function(str){
			var bl = str ? true : false;
			return(bl);
		},
		testMail: function(str){
			var myReg = /^[.-_A-Za-z0-9]+@([_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/;
			return($.testAct(str,myReg));
		},
		testChinese: function(str){
			var myReg = /^[\u2E80-\u9FFF]+$/;
			return($.testAct(str,myReg));
		},
		testEnglish: function(str){
			var myReg = /^[A-Za-z]+$/;
			return($.testAct(str,myReg));
		},
		testChinaName: function(str){
			var myReg = /^[\u2E80-\u9FFF]{2,}$/;
			return($.testAct(str,myReg));
		},
		testDate: function(str){
			var date = str;
            var result = date.match(/^(\d{1,4})(\/)(\d{1,2})\2(\d{1,2})$/);
            var c = new Date();
            if (result == null || result[1] < c.getFullYear()-100 || result[1] > c.getFullYear()+5)
                return false;
            var d = new Date(result[1], result[3] - 1, result[4]);
            return (d.getFullYear() == result[1] && (d.getMonth() + 1) == result[3] && d.getDate() == result[4]);
		},
		testNumber: function(str){
			var myReg = /^[0-9]/;
			return($.testAct(str,myReg));
		},
		testMail: function(str){
			var myReg = /^[a-z\d]+(\.[a-z\d]+)*@([\da-z](-[\da-z])?)+(\.{1,2}[a-z]+)+$/;
			return($.testAct(str,myReg));
		},
		testMobile: function(str){
			var myReg = /^(1(([35][0-9])|(47)|[8][0123456789]))\d{8}$/;
			return($.testAct(str,myReg));
		},
		testPhone: function(str){
			var myReg = /^\d{10,12}$/;
			return($.testAct(str,myReg));
		},
		QueryString: function(str){
			var sValue=location.search.match(new RegExp("[\?\&]"+str+"=([^\&]*)(\&?)","i"));
			return sValue?sValue[1]:sValue;
		},
	});

	//console.log(user.boxes.login.addClass('class_name').appendTo('body'))
	var wh = $(window).height();


	//导航分享菜单显示隐藏
	$('.share').on('click', function(){
		$('.shareinfo').toggle();
	});

	//首页第一屏高度随屏幕
	$('#indexmain').css({'height':wh-75});
	$('.main2').css({'marginTop':wh});

});

